import request from '@/utils/request'
import {getToken} from  '../login'
import axios from '@/utils/axios'

// 查询设备日志列表
export function listDevicelog(query) {
  return request({
    url: '/wx/devicelog/list',
    method: 'get',
    params: query
  })
}

// 查询设备日志详细
export function getDevicelog(deviceLogId) {
  return request({
    url: '/wx/devicelog/' + deviceLogId,
    method: 'get'
  })
}

// 新增设备日志
export function addDevicelog(data) {
  return request({
    url: '/wx/devicelog',
    method: 'post',
    data: data
  })
}

// 修改设备日志
export function updateDevicelog(data) {
  getToken('','');
  return request({
    url: '/wx/devicelog',
    method: 'put',
    data: data
  })
}

// 删除设备日志
export function delDevicelog(deviceLogId) {
  return request({
    url: '/wx/devicelog/' + deviceLogId,
    method: 'delete'
  })
}

export function getCurrentLocation() {
getToken('','');
  return axios.post('https://api.ly-gps.com/lygps-api/v2/locate/getDeviceLocate',
    {},
    {
      headers:{
        identityId:sessionStorage.getItem("identityId"),
        token:sessionStorage.getItem("token")
      }
  })
}
